<!DOCTYPE html>
<html ng-app="app" ng-controller="indexCtrl">

	<head lang="en">
		<meta charset="UTF-8">
		<meta http-equiv="Expires" content="0">
		<meta http-equiv="Pragma" content="no-cache">
		<meta http-equiv="Cache-control" content="no-cache">
		<meta http-equiv="Cache" content="no-cache">
		<title>广告投放-广告主</title>
		<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" id="favicon">
		<link rel="stylesheet" href="lib/bootstrap/css/bootstrap.min.css" />
		<link rel="stylesheet" href="css/bootstrap-datetimepicker.min.css" />
		<link rel="stylesheet" href="css/base.css" />
		<link rel="stylesheet" href="modules/agent/agIndex/agIndex.css" />
		<link rel="stylesheet" href="../../oem/css/common.css" />
		<style>
			.order-row{
				padding-top: 20px;
			}
			.publish-source .content ul {
				width: 1200px;
				max-height: 360px;
				overflow-y: auto;
			}
			
			.publish-source .content li {
				width: 170px;
				height: 88px;
				position: relative;
				margin-left: 5px;
				margin-bottom: 5px;
				padding: 8px 9px 0 30px;
				float: left;
				cursor: pointer;
			}
			
			.publish-source .content .checked {
				background: url(images/icon_check_true_new.png) no-repeat;
			}
			
			.publish-source {
				width: 1200px;
				overflow: hidden;
				display: inline-block;
			}
			
			.publish-source .content li .ps-pic {
				width: 100%;
				border-bottom: 1px solid #e8e6e4;
				text-align: center;
			}
			
			.publish-source .content li .ps-pic .icon {
				width: 34px;
				height: 34px;
				margin-bottom: 8px;
			}
			
			.publish-source .content li .ps-text {
				width: 100%;
				line-height: 30px;
				text-align: center;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
			}
			.material-cover {
			    width: 122px;
			    height: 130px;
			    background-color: #808080;
			    margin: 30px auto;
			    background-position: center;
			    background-repeat: no-repeat;
			    background-size: contain;
			    cursor: pointer;
			    position: relative;
			}
		</style>
	</head>

	<body>
		<div class="nav_top">
			<div class="logo fl" id="logo">
			</div>
			<ul class="nav_list fl">

				<li ng-if="permission.view['首页']" class="ng-scope">
					<a ui-sref="agent.home" ui-sref-active="active" href="./agentIndex.html" class="active">首页</a>
				</li>

				<li ng-if="permission.view['投放管理']" class="ng-scope">

					<a href="./active.html" class="toFirstSub">投放管理</a>
					<ul class="nav_dropdown" style="width: 1903px;">

						<li ng-if="permission.view['投放管理'].sub['活动管理']" class="ng-scope">
							<a href="./active.html" ui-sref-active="active" ui-sref="agent.delivery.active" class="">活动管理</a>
						</li>
						<!-- end ngIf: permission.view['投放管理'].sub['活动管理'] -->
						<!-- ngIf: permission.view['投放管理'].sub['订单管理'] -->
						<li ng-if="permission.view['投放管理'].sub['订单管理']" class="ng-scope">
							<a href="./order.html" ui-sref-active="active" ui-sref="agent.delivery.order" class="">订单管理</a>
						</li>
						<!-- end ngIf: permission.view['投放管理'].sub['订单管理'] -->
						<!-- ngIf: permission.view['投放管理'].sub['素材信息'] -->
						<li ng-if="permission.view['投放管理'].sub['素材信息']" class="ng-scope">
							<a href="./creative.html" ui-sref-active="active" ui-sref="agent.delivery.creative" class="">素材信息</a>
						</li>
						<!-- end ngIf: permission.view['投放管理'].sub['素材信息'] -->
						<!-- ngIf: permission.view['投放管理'].sub['APP监测'] -->
						<li ng-if="permission.view['投放管理'].sub['APP监测']" class="ng-scope">
							<a href="./audiences.html" ui-sref-active="active" ui-sref="agent.delivery.audiences" class="">监测管理</a>
						</li>
						<!-- end ngIf: permission.view['投放管理'].sub['APP监测'] -->
						<!-- ngIf: hasDepot -->
					</ul>
				</li>
				<!-- end ngIf: permission.view['投放管理'] -->
				<!-- ngIf: permission.view['报表中心'] -->
				<li ng-if="permission.view['报表中心']" class="ng-scope">
					<!--<a ui-sref="agent.report" ui-sref-active="active">报表</a>-->
					<a href="./baoBiao.html" class="toFirstSub" ng-class="{'active':$state.includes('agent.report.*')}">报表中心</a>
					<ul class="nav_dropdown" style="width: 1903px;">

						<li ng-if="permission.view['报表中心'].sub['效果报表']" class="ng-scope">
							<a href="./baoBiao.html" ui-sref-active="active" ui-sref="agent.report.effect({'activeID':'0','activeName':'0','orderID':'0','orderName':'0'})" class="">效果报表</a>
						</li>
						<li ng-if="permission.view['合约报表'].sub['效果报表']" class="ng-scope">
							<a href="./heyuebaobiao.html" ui-sref-active="active" ui-sref="agent.report.effect({'activeID':'0','activeName':'0','orderID':'0','orderName':'0'})" class="">合约报表</a>
						</li>
					</ul>
				</li>

				<li ng-if="permission.view['系统管理']" class="ng-scope">
					<a href="./baseInfo.html" class="toFirstSub" ng-class="{'active':$state.includes('agent.manage.*')}">系统管理</a>
					<ul class="nav_dropdown" style="width: 1903px;">

						<li ng-if="permission.view['系统管理'].sub['基本信息']" class="ng-scope">
							<a href="./baseInfo.html" ui-sref-active="active" ui-sref="agent.manage.baseInfo" class="">基本信息</a>
						</li>

						<li ng-if="permission.view['系统管理'].sub['资质管理']" class="ng-scope">
							<a href="./qualifications.html" ui-sref-active="active" ui-sref="agent.manage.qualifications" class="">资质管理</a>
						</li>

					</ul>
				</li>

				<li ng-if="permission.view['财务管理']" class="ng-scope">

					<a href="./caiwu.html" class="toFirstSub" ng-class="{'active':$state.includes('agent.finance.*')}">财务管理</a>
					<ul class="nav_dropdown" style="width: 1903px;">

						<li ng-if="permission.view['财务管理'].sub['财务信息']" class="ng-scope">
							<a href="./caiwu.html" ui-sref-active="active" ui-sref="agent.finance.trade" class="">财务信息</a>
						</li>

					</ul>
				</li>

			</ul>
			<div class="user">
				<div class="user-avatar"></div>
				<div class="user-info">
					<p></p>
					<p></p>
				</div>
				<ul class="user-list">
					<li>余额：</li>
					<li>退出登录</li>
				</ul>
			</div>
		</div>
		<ui-view class="ng-scope">
			<!-- uiView:  -->
			<ui-view class="ng-scope">
				<div class="active-page page ng-scope">
					<!--页面标题-->
					<h3 class="page-title">首页</h3>
					<!--总计列表-->
					<ul class="deal-list">
						<li>
							<p>曝光量</p>
							<h3 class="ng-binding viewSum1"></h3>
							<span class="ng-binding">昨日:<span class="viewSum2"></span></span><span class="ng-binding">前日:<span class="viewSum3"></span></span>

						</li>
						<li>
							<p>点击量</p>
							<h3 class="ng-binding clickSum1"></h3>
							<span class="ng-binding ">昨日:<span class="clickSum2"></span></span><span class="ng-binding ">前日:<span class="clickSum3"></span></span>
						</li>
						<li>
							<p>点击率</p>
							<h3 class="ng-binding clickRate1"></h3>
							<span class="ng-binding ">昨日:<span class="clickRate2"></span></span><span class="ng-binding ">前日:<span class="clickRate3"></span></span>
						</li>
						<li>
							<p>花费(元)</p>
							<h3 class="ng-binding expenditureSum1"></h3>
							<span class="ng-binding ">昨日:<span class="expenditureSum2"></span></span><span class="ng-binding">前日:<span class="expenditureSum3"></span></span>
						</li>
						<li>
							<p>CPM(元)</p>
							<h3 class="ng-binding cpmSum1"></h3>
							<span class="ng-binding ">昨日:<span class="cpmSum2"></span> </span><span class="ng-binding ">前日:<span class="cpmSum3"></span></span>
						</li>
						<li>
							<p>CPC(元)</p>
							<h3 class="ng-binding cpcSum1"></h3>
							<span class="ng-binding ">昨日:<span class="cpcSum2"></span></span><span class="ng-binding ">前日:<span class="cpcSum3"></span></span>
						</li>
					</ul>
					<!--趋势分析-->
					<div class="chart-box bs">
						<div class="chart-title">

							<h3>趋势分析</h3>
						</div>
						<!-- 为 ECharts 准备一个具备大小（宽高）的 DOM -->
						<div class="chart" id="main" style=" width: 1609px; height: 400px;"></div>
					</div>

					<h4 class="order-row">媒体列表</h4>
					<div class="form-group publish-box">
						<div style="text-align: center;margin: 0 auto;">
							<div media="mediaName" config="mediaConfig" is-search="true" class="publish-source ">
								<div class="content">
									<ul class="cl" id="mediaList">
										<!--<li class="fl ng-scope checked">
											<div class="ps-pic"><img src="http://qiniu.hubcloud.com.cn/o_1bklhtvp911ur1k9ioa11sju1dsc9.png" class="icon"></div>
											<div class="ps-text ng-binding"> 超级淘IOS</div>
										</li>-->

									</ul>
								</div>
							</div>
						</div>
					</div>
					
					<div class="table-box creative-table">
				<div class="table-title">
					<h3 class="table-title-font">素材信息</h3>
				</div>
				<table class="table spaceTable">
					<thead>
						<tr>
							<th style="text-align:center;">素材</th>
							<th>创意信息</th>
							<th>素材内容</th>
							<th>审核状态</th>
						</tr>
					</thead>
					<tbody ng-repeat="i in list" on-finish-render="" class="ng-scope" id="suCaiList_box">
						<tr>
							<td class="spaceInfo">
								<div class="material-cover ng-scope" ng-if="i.hasImg" ng-style="{'background-image':'url('+i.preview+')'}" style="background-image: url(&quot;http://res1.hubcloud.com.cn/dsp/ad/2018/11/6/1541500217278.jpg&quot;);">
									<div class="material-cover-mask" ng-click="showImg(i.preview)"></div>
								</div>
							</td>
							<td class="spaceInfo">
								<span class="ng-binding">创意名称：640*100</span><br><br>
								<span class="ng-binding">创意ID：89899</span><br><br>
								<span class="ng-binding">广告位类型：banner</span><br><br>
								<span class="ng-binding">交互方式：</span><br><br>
							</td>
							<td class="spaceContent">
								<div ng-repeat="m in i.material" class="ng-scope">
									<div ng-if="m.image" class="ng-scope">
										<span>图片：</span>
										<a href="javascript:;" ng-click="showImg(m.image.url)">查看图片</a><br><br>
									</div>
								</div>
								<div class="ng-binding">
									
									曝光监测：<br><br>
									
								</div>
							</td>
							<td class="btns">
								<span class="audit audit-orange">
                                            内审状态
                                            <span class="audit-text ng-binding">
                                                审核通过
                                            </span>
								</span>
								<span class="audit audit-blue">
                                            待审核的平台
                                            <span class="audit-text ng-binding">
                                                0
                                            </span>
								</span>
								<span class="audit audit-green">
                                            通过审核的平台
                                            <span class="audit-text ng-binding">
                                                1
                                                <ul class="adx-tips ng-scope"
                                                    ng-if="i.adxAuditList.approved.length > 0">
                                                    <li ng-repeat="a in i.adxAuditList.approved"
                                                        class="ng-binding ng-scope">自有ADX</li>
                                                </ul>
                                            </span>
								</span>
								<span class="audit audit-red">
                                            审核拒绝的平台
                                            <span class="audit-text ng-binding">
                                                0
                                            </span>
								</span>
							</td>
						</tr>
					</tbody>
				</table>
				<div class="page" id="pageToolbar">
					<div id="Paging_03779053995874404" class="ui-paging-container">
						<ul>
							<li class="js-page-first js-page-action ui-pager ui-pager-disabled">首页</li>
							<li class="js-page-prev js-page-action ui-pager ui-pager-disabled">上一页</li>
							<li data-page="1" class="ui-pager focus">1</li>
							<li class="ui-paging-toolbar"><span>跳转到</span><input type="text" class="ui-paging-count" value="1"> 页
								<select class="ui-select-pagesize">
									<option value="20">每页展示20条/页</option>
									<option value="50">每页展示50条/页</option>
									<option value="100">每页展示100条/页</option>
								</select><span> </span></li>
							<li class="js-page-last js-page-action ui-pager ui-pager-disabled">末页</li>
							<li class="js-page-next js-page-action ui-pager ui-pager-disabled">下一页</li>
						</ul>
					</div>
				</div>
			</div>


				</div>
			</ui-view>
		</ui-view>

	</body>

</html>
<script src="../res1.hubcloud.com.cn/lib/jquery/jquery.min.js"></script>
<script src="js/js_1.js"></script>
<script src="js/echarts.min.js"></script>
<script src="../res1.hubcloud.com.cn/lib/layer/layer.js"></script>

<!-- <script src="../res1.hubcloud.com.cn/lib/layer/layer.js"></script>
<script src="../res1.hubcloud.com.cn/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="../res1.hubcloud.com.cn/lib/calendar/calendar.js"></script>

<script src="../res1.hubcloud.com.cn/lib/qiniu/plupload/moxie.js"></script>
<script src="../res1.hubcloud.com.cn/lib/query.js"></script>
<script src="../res1.hubcloud.com.cn/lib/paging.js"></script>
<script src="js/commen.js?rand=v1.0.54"></script>
<script src="./js/factory/proxy.js"></script> -->
<!-- <script src="./modules/agent/app.js?rand=v1.0.54"></script> -->
<!-- <script src="./modules/agent/router.js?rand=v1.0.54"></script> -->

<script>
	$(function() {

		getIndexData();
		getAdvertisInfoByUserId();
		$('.user').on('click', function() {
			$(this).toggleClass('hover');
		})

		$('.user').mouseleave(function() {
			$(this).removeClass('hover');
		});

		$('.dropdown').on('click', function() {

			if($(this).hasClass("open")) {
				$(this).removeClass('open');
			} else {
				$('.dropdown').removeClass('open');
				$(this).addClass('open');
			}
		})

	})

	//首页(广告)数据统计(今天昨天前天统计)
	function getIndexData() {
		// $("#zhiDing").val(page);
		let token = sessionStorage.getItem("token");
		// var d = {};
		// d.page = page;
		// d.pageSize = pageSize;
		// if(!state){
		//     d.state = null;
		// }else{
		//     d.state = state;
		// }
		$.ajax({
			url: url + "/advertiser/adStatistics/getAdvertisInfo",
			type: 'GET',
			//		参数需转为字符串
			// data: JSON.stringify(d),
			//		json跨域
			dataType: 'json',
			//		contentType类型为json
			contentType: "application/json",

			//		请求头加上X-Token 
			beforeSend: function(XMLHttpRequest) {
				//		token 为页面所获取

				XMLHttpRequest.setRequestHeader("X-Token", token);
			},
			useDefaultXhrHeader: false,
			success: function(result) {
				//				console.log(result);
				//				console.log(result.data.today.viewSum);
				if(result.code == '0') {
					$('.viewSum1').html(result.data.today.viewSum);
					$('.clickSum1').html(result.data.today.clickSum);
					$('.clickRate1').html(result.data.today.clickRate);
					$('.expenditureSum1').html(result.data.today.expenditureSum);
					$('.cpmSum1').html(result.data.today.cpmSum);
					$('.cpcSum1').html(result.data.today.cpcSum);

					$('.viewSum2').html(result.data.yesterday.viewSum);
					$('.clickSum2').html(result.data.yesterday.clickSum);
					$('.clickRate2').html(result.data.yesterday.clickRate);
					$('.expenditureSum2').html(result.data.yesterday.expenditureSum);
					$('.cpmSum2').html(result.data.yesterday.cpmSum);
					$('.cpcSum2').html(result.data.yesterday.cpcSum);

					$('.viewSum3').html(result.data.beforyesterday.viewSum);
					$('.clickSum3').html(result.data.beforyesterday.clickSum);
					$('.clickRate3').html(result.data.beforyesterday.clickRate);
					$('.expenditureSum3').html(result.data.beforyesterday.expenditureSum);
					$('.cpmSum3').html(result.data.beforyesterday.cpmSum);
					$('.cpcSum3').html(result.data.beforyesterday.cpcSum);
				} else {
					isErr(result);
				}
			},
			err: function(err) {
				layer.msg("请求失败");
			},
			complete: function() {
				// $(_that).removeAttr("disabled");
			}
		});
	}

	function xiaBiaoLine(e) {
		console.log(e);
		$(e).addClass('active');
	}

	//查询首页(广告)柱状图数据根据UserId与时间段
	function getAdvertisInfoByUserId() {
		// $("#zhiDing").val(page);
		let token = sessionStorage.getItem("token");
		// var d = {};
		// d.page = page;
		// d.pageSize = pageSize;
		// if(!state){
		//     d.state = null;
		// }else{
		//     d.state = state;
		// }
		$.ajax({
			url: url + "/advertiser/adStatistics/getAdvertisInfoByUserId",
			type: 'GET',
			//		参数需转为字符串
			// data: JSON.stringify(d),
			//		json跨域
			dataType: 'json',
			//		contentType类型为json
			contentType: "application/json",

			//		请求头加上X-Token 
			beforeSend: function(XMLHttpRequest) {
				//		token 为页面所获取

				XMLHttpRequest.setRequestHeader("X-Token", token);
			},
			useDefaultXhrHeader: false,
			success: function(result) {
				console.log(result);
				if(result.code == '0') {
					var data = result.data;
					var data1 = [];
					var data2 = [];
					var data3 = [];
					var data4 = [];
					var data5 = [];
					var zx_time = [];
					for(var i in data) {
						data1.push(data[i].click);
						data2.push(data[i].clickRate);
						data3.push(data[i].cpc);
						data4.push(data[i].cpm);
						data5.push(data[i].view);
						zx_time.push(data[i].period);
					}
					kd(data1, data2, data3, data4, data5, zx_time);

				} else {
					isErr(result);
				}
			},
			err: function(err) {
				layer.msg("请求失败");
			},
			complete: function() {
				// $(_that).removeAttr("disabled");
			}
		});
	}

	function kd(data1, data2, data3, data4, data5, zx_time) {
		var myChart = echarts.init(document.getElementById('main'));

		var posList = [
			'left', 'right', 'top', 'bottom',
			'inside',
			'insideTop', 'insideLeft', 'insideRight', 'insideBottom',
			'insideTopLeft', 'insideTopRight', 'insideBottomLeft', 'insideBottomRight'
		];
		var app = {};
		app.configParameters = {
			rotate: {
				min: -90,
				max: 90
			},
			align: {
				options: {
					left: 'left',
					center: 'center',
					right: 'right'
				}
			},
			verticalAlign: {
				options: {
					top: 'top',
					middle: 'middle',
					bottom: 'bottom'
				}
			},
			position: {
				options: echarts.util.reduce(posList, function(map, pos) {
					map[pos] = pos;
					return map;
				}, {})
			},
			distance: {
				min: 0,
				max: 100
			}
		};

		app.config = {
			rotate: 90,
			align: 'left',
			verticalAlign: 'middle',
			position: 'insideBottom',
			distance: 15,
			onChange: function() {
				var labelOption = {
					normal: {
						rotate: app.config.rotate,
						align: app.config.align,
						verticalAlign: app.config.verticalAlign,
						position: app.config.position,
						distance: app.config.distance
					}
				};
				myChart.setOption({
					series: [{
						label: labelOption
					}, {
						label: labelOption
					}, {
						label: labelOption
					}, {
						label: labelOption
					}]
				});
			}
		};

		var labelOption = {
			normal: {
				show: false,
				position: app.config.position,
				distance: app.config.distance,
				align: app.config.align,
				verticalAlign: app.config.verticalAlign,
				rotate: app.config.rotate,
				formatter: '{name|{a}}',
				fontSize: 16,
				rich: {
					name: {
						textBorderColor: '#fff'
					}
				}
			}
		};
		option = {
			color: ['#003366', '#006699', '#4cabce', '#e5323e', '#e5863e', '#a2374e'],
			tooltip: {
				trigger: 'axis',
				axisPointer: {
					type: 'shadow'
				}
			},
			legend: {
				data: ['点击量', '点击率', 'CPC', 'CPM', '曝光量', ]
			},
			toolbox: {
				show: true,
				x: '100', // 水平安放位置，默认为全图右对齐，可选为：
				y: 'top', // 垂直安放位置，默认为全图顶端，可选为：

				showTitle: true,
				feature: {
					magicType: {
						show: true,

						type: ['line', 'bar']
					}
				}
			},
			calculable: true,
			xAxis: [{
				type: 'category',
				axisTick: {
					show: false
				},
				data: zx_time
			}],
			yAxis: [{
				show: true,
				axisTick: {
					show: false
				},
				splitLine: {
					show: false
				},
			}],
			series: [{
					name: '点击量',
					type: 'bar',
					barGap: 0,
					label: labelOption,
					data: data1
				},
				{
					name: '点击率',
					type: 'bar',
					label: labelOption,
					data: data2
				},
				{
					name: 'CPC',
					type: 'bar',
					label: labelOption,
					data: data3
				},
				{
					name: 'CPM',
					type: 'bar',
					label: labelOption,
					data: data4
				},
				{
					name: '曝光量',
					type: 'bar',
					label: labelOption,
					data: data5
				},

			]
		};
		// 使用刚指定的配置项和数据显示图表。
		myChart.setOption(option);
	}
</script>
<script src="../../oem/js/oem.js"></script>
<script>
	$.ajax({
		url: url + "/sys/sysDict/getMedias",
		type: "get",
		//		参数需转为字符串
		//		json跨域
		dataType: 'json',

		//		contentType类型为json
		contentType: "application/json",
		useDefaultXhrHeader: false,
		//		请求头加上X-Token 
		 beforeSend: function(XMLHttpRequest) {
			//		token 为页面所获取
			XMLHttpRequest.setRequestHeader("X-Token", token); 
		},
		success: function(result) {
			console.log(result);

			if(result.code == '0') {
				var html = "";
				for(var i = 0; i < result.data.length; i++) {
					html += '<li class="fl ng-scope checked"><div class="ps-pic">';
					html += '<img src="' + result.data[i].value + '" class="icon"></div>';
					html += '<div class="ps-text"> ' + result.data[i].name + '</div></li>';
				}
				$("#mediaList").html(html);
			}
		},
		err: function(err) {
			layer.msg("请求失败");
		}
	});
</script>
<script>
	var page = 1; //第几页
	var pageSize = 20; //一页多少条
	var state = null; //全部审核状态
	var name = ""; //素材创意名称
	var allPageNum = ''; //总页数
	$(function() {
		$('.dropdown').on('click', function() {
			if($(this).hasClass("open")) {
				$(this).removeClass('open');
			} else {
				$('.dropdown').removeClass('open');
				$(this).addClass('open');
			}
		})
		queryOriPage(page, pageSize, name, state);

	})

	//获取素材信息
	// originalityName	string
	// 创意名称

	// page	integer($int32)
	// example: 1
	// 页数:默认第一页

	// pageSize	integer($int32)
	// example: 10
	// 页码:默认十条信息

	// state	integer($int32)
	// 状态 0.待审核 1.审核通过 2.审核拒绝

	function queryOriPage(page, pageSize, name, state) {
		var d = {};
		d.page = page;
		d.pageSize = pageSize;
		d.originalityName = name;
		d.state = state;
		$.ajax({
			type: "POST",
			url: url + "/advertiser/adOrderOri/queryOriPage",

			//		参数需转为字符串
			data: JSON.stringify(d),

			//		json跨域
			dataType: 'json',
			//		contentType类型为json
			contentType: "application/json",

			//		请求头加上X-Token 
			beforeSend: function(XMLHttpRequest) {
				//		token 为页面所获取
				let token = sessionStorage.getItem("token");
				XMLHttpRequest.setRequestHeader("X-Token", token);
			},
			useDefaultXhrHeader: false,
			success: function(result) {
				console.log(result);
				$('#suCaiList_box').html('');
				let html = '';
				let listData = result.data.rows;
				listData.forEach(function(item,index) {
					let state = item.state;
					
					if(state == 0) {
						state = '待审核';
					} else if(state == 1) {
						state = '审核通过';
					} else {
						state = '审核拒绝';
					}
					let originalityType = item.originalityType;
					let isImg = "图片";
					let isshowImg = 'showImg';
					if(originalityType == 2){
						originalityType = 'showImg2';
						isImg = "视频";
						isshowImg = "showImg2";
					}else{
						originalityType = 'showImg';
					}
					
					let originalityAdType = item.originalityAdType;
					if(originalityAdType == 0){
						originalityAdType = '开屏';
					}else if(originalityAdType == 1){
						originalityAdType = '插屏';
					}else if(originalityAdType == 2){
						originalityAdType = 'Banner';
					}else{
						originalityAdType = '原生';
					}
					
					let squeezePage = item.squeezePage;
					if(!squeezePage){
						squeezePage = "";
					}
					
					html += `
                    <tr>
                        <td class="spaceInfo">
                            <div class="material-cover" style="background-image: url(&quot;${item.photoUrl}&quot;);">
                                <div class="material-cover-mask" onclick="${isshowImg}(this)"></div>
                                <input type="hidden" value="${item.photoUrl}"/>
                            </div>
                        </td>
                        <td class="spaceInfo">
                            <span>创意名称：${item.originalityName}</span><br><br>
                            <span>创意ID：${item.id}</span><br><br>
                            <span>广告位类型：${originalityAdType}</span><br><br>
                            <span>交互方式：仅展示</span><br><br>
                        </td>
                        <td class="spaceContent">
                            <div>
                                <div>
                                    <span>${isImg}：</span>
                                    <a href="javascript:;" onclick="${originalityType}(this)">查看${isImg}</a>
                                    <input type="hidden" value="${item.photoUrl}"/>
                                    <br><br>
                                </div>
                            </div>
                            <div>
                                
                                曝光监测：${item.exposureMonitor}<br><br>
                               
                            </div>
                            <div>
                            	落地页:<a href="${squeezePage}" style="color:#00aaee;">${squeezePage}</a>
                            </div>
                        </td>
                        <td class="btns">
                            <span class="audit audit-orange">
                                内审状态
                                <span class="audit-text">
                                    ${state}
                                </span>
                            </span>
                          
                        </td>
                    </tr>
                            `;
				})
				$('#suCaiList_box').append(html);
			},
			err: function(err) {
				layer.msg("请求失败");
			},
			complete: function() {
				
			}
		});
	}

	function showImg(obj) {
		let src = $(obj).next().val();

		layer.open({
			type: 1,
			title: false,
			closeBtn: 0,
			area: '516px',
			skin: 'layui-layer-nobg', //没有背景色
			shadeClose: true,
			content:'<img src="' + src + '"></img>'
			
		});
	}
	
	function showImg2(obj) {
		let src = $(obj).next().val();

		layer.open({
			type: 1,
			title: false,
			closeBtn: 0,
			
			skin: 'layui-layer-nobg', //没有背景色
			shadeClose: true,
			content:'<video width="320" height="240" controls><source src="'+src+'" type="video/mp4"><source src="'+src+'" type="video/ogg"></video>'
			
		});
	}

	function clickFunc(e) {
		$('#showState').text($(e).children('a').text());
		state = $(e).children('a').attr('data-state');

		queryOriPage(page, pageSize, name, state);
	}

	//回车搜索素材名称
	function shuRuSuCai() {
		name = $('#suCaisearch').val();
		queryOriPage(page, pageSize, name, state);  
	}

	$('.user').on('click', function() {
		$(this).toggleClass('hover');
	})

	$('.user').mouseleave(function() {
		$(this).removeClass('hover');
	});
</script>
